package com.gt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gt.entity.log.InterfaceLog;
import com.gt.service.Log.InterfaceLogService;
import com.gt.mapper.InterfaceLogMapper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/*
 * @功能说明：日志修改服务实现层
 * @作者： herun
 * @创建日期：2021/8/19
 * @版本号：V1.0
 */
@Service
public class InterfaceLogServiceImpl extends ServiceImpl<InterfaceLogMapper, InterfaceLog> implements InterfaceLogService {

    @Resource
    private InterfaceLogMapper interfaceLogMapper;


    /**
     * @param log
     * @Description: 日志异步入库
     * @Async("logThread") 对应线程池 Bean 名称
     */
    @Override
    @Async("logThread")
    public void saveLog(InterfaceLog log) {
        interfaceLogMapper.insert(log);
    }

    /**
     * @param log
     * @Description: 日志异步入库
     * @Async("logThread") 对应线程池 Bean 名称
     */
    @Override
    @Async("logThread")
    public void updateLogById(InterfaceLog log) {
        interfaceLogMapper.updateById(log);
    }

    @Override
    public int mycount() {
        return interfaceLogMapper.countTest();
    }


}
